package com.cqupt.sendMes.utils;

import java.util.HashSet;
import java.util.Set;

import lombok.Data;

/**
 * @author dell
 */
@Data
public class Message {
    /**
     * 1:text，可以直接显示在卡片里面
     * 2:html，点击以后查看，支持html
     * 3:md，markdown格式，和html类似
     */
    public static final int CONTENT_TYPE_TEXT = 1;
    public static final int CONTENT_TYPE_HTML = 2;
    public static final int CONTENT_TYPE_MD = 3;

    /**
     * verifyPayType=0，表示本条消息，不验证付费状态，发送给所有用户
     * verifyPayType=1，表示本条消息，只发送给付费订阅期内的用户
     * verifyPayType=2，表示本条消息，只发送给未订阅或者付费订阅过期的用户
     */
    public static final int VERIFY_PAY_TYPE_IGNORE = 0;
    public static final int VERIFY_PAY_TYPE_IN_PAY = 1;
    public static final int VERIFY_PAY_TYPE_OUT_PAY = 2;

    private String appToken;

    //发送的目标
    private Set<String> uids = new HashSet<>();
    private Set<Long> topicIds = new HashSet<>();

    private Integer contentType;

    private String content;

    private String summary;

    /**
     * 是否验证付费
     * @deprecated 请使用verifyPayType
     */
    @Deprecated
    private Boolean verifyPay;

    private Integer verifyPayType;

    /**
     * 仅针对text消息类型有效
     */
    private String url;

    public void setUid(String uid) {
        this.uids = new HashSet<>(1);
        this.uids.add(uid);
    }
    public void setTopicId(Long topicId) {
        this.topicIds = new HashSet<>(1);
        this.topicIds.add(topicId);
    }
}